package com.tte.common.model.vo;

import com.tte.common.model.tenum.ResultCode;

import java.io.Serializable;
import java.util.Date;

/**
 * 返回数据基础类
 */
public class ResultBean implements Serializable {
    //返回结果状态
    private int code;
    //返回消息
    private String message;
    //返回数据
    private Object object;
    //返回当前时间
    private Date date;

    public ResultBean() {
    }

    public ResultBean(ResultCode resultCode) {
        this.code = resultCode.code();
        this.message = resultCode.value();
        this.date = new Date();
    }
    public ResultBean(ResultCode resultCode,Object object) {
        this.code = resultCode.code();
        this.message = resultCode.value();
        this.object = object;
        this.date = new Date();
    }
    public ResultBean(int code, String message ) {
        this.code = code;
        this.message = message;
        this.date = new Date();

    }
    public ResultBean(int code, String message, Object object) {
        this.code = code;
        this.message = message;
        this.object = object;
        this.date = new Date();
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getObject() {
        return object;
    }

    public void setObject(Object object) {
        this.object = object;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @Override
    public String toString() {
        return "ResultBean{" +
                "code=" + code +
                ", message='" + message + '\'' +
                ", object=" + object +
                ", date=" + date +
                '}';
    }
}